/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ducas.getprice.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;

/**
 *
 * @author Administrator
 */
public class DataAccessObject {
//These variable values are used to setup the Connection object
    static final String URL = "jdbc:mysql://localhost:3306/";
    static final String DBNAME = "report_test_4";
    static final String USER = "root";
    static final String PASSWORD = "root";
    static final String MySQL_DRIVER = "com.mysql.jdbc.Driver";

    public Connection getConnection() throws SQLException {
        Connection conn = null;
        try {
            Class.forName(MySQL_DRIVER);
            conn = DriverManager.getConnection(URL + DBNAME, USER, PASSWORD);
        } catch (ClassNotFoundException e) {
            System.out.println(e.getMessage());
            System.exit(1);
        }
        return conn;
    }
}
